﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace coffeeshop
{
    public class Global
    {
        private static System.Resources.ResourceManager mv_Resources = new System.Resources.ResourceManager("coffeeshop.Properties.Resources", System.Reflection.Assembly.GetExecutingAssembly());
        //Num of tables display on a row.
        public const int NumOfRowTable = 15;

        public enum CaLamViec : int
        {
            None = 0,
            CaSang = 1,
            CaTrua = 2,
            CaChieu = 3
        }

        public enum TableStatus : int
        {
            Available = 0,
            Servicing = 1,
            Billed = 2,
            Changed = 3
        }

        public enum UserRoleId : int
        {
            None = 0,
            SuperUser = 1,
            Admin = 2,
            Cashier = 3,
            Waiter = 4
        }

        public enum OrderType : byte 
        { 
            None = 0,
            OrderNew = 1,
            OrderPlus = 2,
            OrderReturn = 3
        }

        public static string GetRoleName(UserRoleId role)
        {
            string result = "Nhân viên";
            switch (role)
            {
                case UserRoleId.Admin:
                    result = "Admin";
                    break;
                case UserRoleId.Cashier:
                    result = "Thu Ngân";
                    break;
                case UserRoleId.Waiter:
                    result = "Phục vụ";
                    break;
                case UserRoleId.SuperUser:
                    result = "Trùm cuối";
                    break;
            }

            return result;
        }

        public static string GetTableOrderStatus(TableStatus v_status)
        {
            string result = mv_Resources.GetString("TABLEUNKNOW");
            switch (v_status)
            {
                case TableStatus.Available:
                    result = mv_Resources.GetString("TABLEAVAILABLE");
                    break;
                case TableStatus.Servicing:
                    result = mv_Resources.GetString("TABLESERVICING");
                    break;
                case TableStatus.Billed:
                    result = mv_Resources.GetString("TABLEBILLED");
                    break;
                case TableStatus.Changed:
                    result = mv_Resources.GetString("TABLECHANGED");
                    break;
                default:
                    result = mv_Resources.GetString("TABLEUNKNOW");
                    break;
            }
            return result;
        }

        public static string GetOrderTypeText(OrderType _type)
        {
            string result = "MỚI";
            switch (_type)
            {
                case OrderType.OrderNew:
                    result = "MỚI";
                    break;
                case OrderType.OrderPlus:
                    result = "THÊM";
                    break;
                case OrderType.OrderReturn:
                    result = "TRẢ";
                    break;
                default:
                    result = "LỖI";
                    break;
            }

            return result;
        }

        public enum ExtraType : byte
        { 
            None = 0,
            Income = 1,
            Outcome = 2,
            Other = 3 // add more if needed
        }
    }
}
